import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'



export default defineConfig({
  resolve: {
    extensions: ['.ts', '.js', '.vue', '.json'],

  },
  plugins: [
    vue(),

  ],
  server: {
    hmr: true,
    proxy: {
      // 选项写法
      '^/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
      '^/faceapi': {
        target: 'http://127.0.0.1:5000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/faceapi/, '')
      }
    }
  },
  css: {
    // css预处理器
    preprocessorOptions: {
      scss: {
        charset: false,
      },
    },
  }
})



